﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Engine.Helpers {

    public class Box3D {

        protected var m_size:Vector3;
        protected var m_position:Vector3;

        public function Box3D(_arg1:Vector3=null, _arg2:Vector3=null){
            this.m_size = new Vector3();
            this.m_position = new Vector3();
            super();
            if (_arg1 != null){
                this.m_position = _arg1.clone();
            };
            if (_arg2 != null){
                this.m_size = _arg2.clone();
            };
        }
        public function get min():Vector3{
            return (this.m_position.clone());
        }
        public function get max():Vector3{
            return (this.m_position.add(this.m_size));
        }
        public function get position():Vector3{
            return (this.m_position.clone());
        }
        public function get size():Vector3{
            return (this.m_size.clone());
        }
        public function get x():Number{
            return (this.m_position.x);
        }
        public function get y():Number{
            return (this.m_position.y);
        }
        public function get z():Number{
            return (this.m_position.z);
        }
        public function get width():Number{
            return (this.m_size.x);
        }
        public function get height():Number{
            return (this.m_size.y);
        }
        public function get length():Number{
            return (this.m_size.z);
        }
        public function set position(_arg1:Vector3):void{
            this.m_position = _arg1.clone();
        }
        public function set size(_arg1:Vector3):void{
            this.m_size = _arg1.clone();
        }
        public function set x(_arg1:Number):void{
            this.m_position.x = _arg1;
        }
        public function set y(_arg1:Number):void{
            this.m_position.y = _arg1;
        }
        public function set z(_arg1:Number):void{
            this.m_position.z = _arg1;
        }
        public function set width(_arg1:Number):void{
            this.m_size.x = _arg1;
        }
        public function set height(_arg1:Number):void{
            this.m_size.y = _arg1;
        }
        public function set length(_arg1:Number):void{
            this.m_size.z = _arg1;
        }
        public function isPointInside(_arg1:Vector3, _arg2:Boolean=true):Boolean{
            var _local3:Vector3 = this.max;
            if (_arg2){
                return ((((((((((((this.m_position.x <= _arg1.x)) && ((_local3.x >= _arg1.x)))) && ((this.m_position.y <= _arg1.y)))) && ((_local3.y >= _arg1.y)))) && ((this.m_position.z <= _arg1.z)))) && ((_local3.z >= _arg1.z))));
            };
            return ((((((((((((this.m_position.x < _arg1.x)) && ((_local3.x > _arg1.x)))) && ((this.m_position.y < _arg1.y)))) && ((_local3.y > _arg1.y)))) && ((this.m_position.z < _arg1.z)))) && ((_local3.z > _arg1.z))));
        }
        public function isBoxIntersecting(_arg1:Box3D, _arg2:Boolean=true):Boolean{
            return (false);
        }

    }
}//package Engine.Helpers 
